package com.maigao.util.context;

import com.maigao.util.RequestUtil;
import com.maigao.util.context.ip.IP;

import javax.servlet.http.HttpServletRequest;

/**
 * @author awei
 * @description:
 * @date 2022/5/21 12:52 上午
 */
public class HttpContext extends Context {
    private HttpContext(String patternUrl, HttpServletRequest request) {
        super();
        final String clientIP = RequestUtil.getRequestIP(request);
        this.setIp(new IP(clientIP, clientIP, ""));
    }

    public static HttpContext create(String patternUrl, HttpServletRequest request) {
        return new HttpContext(patternUrl, request);
    }
}
